package com.jdz.gxq.info.admin.envinfo.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.jdz.gxq.info.admin.envinfo.service.EnvinfoService;
import com.jdz.gxq.info.common.action.CommonAction;

public class DeleteEnvinfoAction extends CommonAction {

	private EnvinfoService envinfoService = null;
	 
	public ActionForward doExecute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws java.lang.Exception {
		
		String id = request.getParameter("id");
		
		String[] ids = id.split(",");
		
		for (String item : ids) {
			envinfoService.deleteEnvinfo(Integer.parseInt(item));
		}

		return mapping.findForward("success");
	}

	public void setEnvinfoService(EnvinfoService envinfoService) {
		this.envinfoService = envinfoService;
	}
}

